<template>
    <div>
        <el-date-picker
            v-model="innerValue"
            type="date"
            @change="handleChange"
        ></el-date-picker>
    </div>
</template>
<script>
    export default {
        model: {
            prop: "value",
            event: "change"
        },
        // 现在的问题是自定义v-model怎么做的呢？
        // vue中不能直接使用props的值么？应该可以哦
        props: {
            value: {
                type: Date,
                default: null,
            },
            onClose: {
                type: Function
            },
            test: {
                type: String,
                default: ''
            }
        },
        data() {
            return {
                innerValue: this.value,
                innerTest: this.test
            }
        },
        methods: {
            handleChange(val) {
                // console.log('change chagne args args args ', val);
                // this.value = val;
                this.$emit("change", val);
            }
        },
        created() {
            // console.log('$attr $attr ', this.$attrs);
            // console.log('props props ', this.$props);
            // console.log('options options ', this.$options);
        }
    }
</script>
<style>

</style>